#!/usr/bin/env python3
# -*- coding=utf-8 -*-
# 题目：编写一个函数，
# 输入n为偶数时，调用函数求1/2+1/4+...+1/n,
# 当输入n为奇数时，调用函数1/1+1/3+...+1/n


def f1():
    n = int(input("input a number: "))
    r = 0
    if n % 2 == 0:
        for i in range(2, n + 2, 2):
            r += 1 / i
    else:
        for i in range(1, n + 2, 2):
            r += 1 / i
    print(r)


f = f1
if __name__ == "__main__":
    f()
